package com.wanma.recuit.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanma.recuit.mapper.JobMapper;
import com.wanma.recuit.pojo.Job;
import com.wanma.recuit.service.JobService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class JobServiceImpl implements JobService {
    @Resource
    private JobMapper jobMapper;
    @Override
    public void insert(Job object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Job object) {

    }

    @Override
    public Job findById(Integer id) {
        return null;
    }

    @Override
    public List<Job> findAll() {
        return null;
    }

    @Override
    public PageInfo<Job> findPage(int pageNum, int pageSize) {
        return null;
    }

    @Override
    public PageInfo<Job> findPage(int pageNum, int pageSize,Job job) {
        PageHelper.startPage(pageNum,pageSize);
        List<Job> jobs = jobMapper.selectList(job);
        PageInfo<Job> pageInfo = new PageInfo<>(jobs,5);
        return pageInfo;
    }

    @Override
    public List<Job> findLatestJob() {
        return jobMapper.selectlatestList();
    }

    @Override
    public List<Job> findList(Job object) {
        return jobMapper.selectList(object);
    }
}
